<?php

namespace createComments;

class CreateComments{
	
	private $con;
	
	public function __construct(){
			
		$this->con = mysqli_connect("10.101.1.88", "167620_mz14316", "Asd33e5fg", "167620-benny");
		// Check connection
		if (mysqli_connect_errno())
		{
		echo "Failed to connect to MySQL: " . mysqli_connect_error();
		}	
	}
	
	//adds comment to database
	public function saveComments($pictureId, $user, $comments){
		mysqli_query($this->con,"INSERT INTO comments (Id, User, comments)
			VALUES ('$pictureId', '$user', '$comments')");
			mysqli_close($this->con);
	}
	
	
	
}
